formCss = {
    init:function(){
        var i,
            forms = document.forms;
        for(i=0;i<forms.length;i+=1){
            formCss.getElm(forms[i]);
        }
    },
    getElm:function(form){
        var i,j,elm,tag,
            elms = [],
			test = [],
            formElms = form.elements;
        for(i=0;i<formElms.length;i+=1){
            elm = formElms[i];
            tag = elm.tagName.toLowerCase()
            if(tag.search(/fields|legend|option/i)!==-1){continue;}
            elms[elms.length]=elm;
        }
        formCss.initSetClass(elms);
    },
    initSetClass:function(elms){
        var i,elm;
        for(i=0;i<elms.length;i+=1){
            elm=elms[i];
            DOMhelp.addEvent(elm,'mouseover',formCss.setClass);
            DOMhelp.addEvent(elm,'mouseout',formCss.removeClass);  
            DOMhelp.addEvent(elm,'focus',formCss.setClass); 
            DOMhelp.addEvent(elm,'blur',formCss.removeClass);
        }  
    },
    setClass:function(e){
        var o = DOMhelp.getTarget(e);
		if(o.tagName.search(/select|option/i)!==-1 || o.type.search(/radio|checkbox/)!==-1){
			DOMhelp.cssjs('add',o.parentNode,'formHover');
		}else{
			DOMhelp.cssjs('add',o,'formElmHover'); 
			DOMhelp.cssjs('add',o.parentNode,'formHover');
        }
		DOMhelp.cancelClick(e);
    },
    removeClass:function(e){
        var o = DOMhelp.getTarget(e);
        if(o.tagName.search(/select|option/i)!==-1 || o.type.search(/radio|checkbox/)!==-1){
			DOMhelp.cssjs('remove',o.parentNode,'formHover'); 
		}else{ 
			DOMhelp.cssjs('remove',o,'formElmHover');
			DOMhelp.cssjs('remove',o.parentNode,'formHover');}
    }
}
formCss.init();